package com.example.football;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

import com.example.football.entity.Schedule;

import java.util.ArrayList;

public class GerenActivity extends AppCompatActivity {

    static public Integer peopleid ;
    static public String account;
    static public String name;
    static public String byteam;

    TextView tv_account;
    TextView tv_name;
    TextView tv_id;
    TextView tv_byteam;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_notifications);

        peopleid = Main2Activity.peopleid;
        account = Main2Activity.account;
        name = Main2Activity.name;
        byteam = Main2Activity.byteam;

        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.hide();
        }

        tv_id = findViewById(R.id.people_id);
        tv_account = findViewById(R.id.people_account);
        tv_name = findViewById(R.id.people_name);
        tv_byteam = findViewById(R.id.people_byteam);
        tv_name.setText(name);
        tv_account.setText("账号："+account);
        tv_id.setText("id："+peopleid);
        tv_byteam.setText("所在球队："+byteam);
    }

    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.tv_backlogin:
                Intent intent = new Intent(this,MainActivity.class);
                startActivity(intent);
                break;
            case  R.id.tv_peopleschedule:
                intent= new Intent(this,PeoplescheduleActivity.class);
                startActivity(intent);
                break;
            case R.id.tv_peopleliketeam:
                intent= new Intent(this,PeopleliketeamActivity.class);
                startActivity(intent);
                break;
            case R.id.tv_peoplelikestar:
                intent= new Intent(this,PeoplelikestarActivity.class);
                startActivity(intent);
                break;
            case R.id.tv_xiugaimima:
                intent = new Intent(this,UppasswordActivity.class);
                startActivity(intent);
                break;
            case R.id.tv_share:
                shareSoftware();
                break;
            case R.id.tv_shuju:
                intent = new Intent(this,AllscheduleActivity.class);
                intent.putExtra("league","英超");
                startActivity(intent);
                break;
            case R.id.no_iv_back:
                finish();
                break;
        }
    }

    private void shareSoftware() {
        //分享软件到其他用户
        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("text/plain");
        String msg = "想更加方便的预定球赛、查看五大联赛新闻吗？快来下载五大联赛智能看球助手APP吧！";
        intent.putExtra(Intent.EXTRA_TEXT,msg);
        startActivity(Intent.createChooser(intent,"分享到...."));
    }


}
